<core:wrap file="_cp/page.html" in="content_zone">

<fetch using='src/fetcher/NodeFetcher' target='node' first='true' >
  <fetch:param path='/images' node_id='{$#request.id}' />
</fetch>

<core:datasource id='node'>

<h1>Images</h1>

<core:include file='_cp/node_breadcrumbs.html'>

<fetch using='src/fetcher/NodeKidsFetcher' target='subfolders'>
  <fetch:param controller='image_folder' parent_id='{$id}' />
</fetch>

<h2>Folders list</h2>

<route_url params="controller:admin_image_folder,action:create" extra='?popup=1&parent={$id}' onclick='return Limb.Http.click(this.href)' alt='Create folder' title='Create folder'>Create folder</route_url>

<form name='list_form' method='post'>

<list:list id='subfolders'>
<table cellpadding="0" cellspacing="0" class='list'>
  <tr class='header'>
   <th><core:INCLUDE file='_cp/selector.html'></th>
   <th>Folder</th>
   <th>Actions</th>
  </tr>
  <list:item>
    <tr>
      <td><input type='checkbox' name='ids[]' value='{$id}' class='input' runat='client'/></td>
      <td><route_url params='id:{$id}'>{$title}</route_url></td>
      <td><route_url params="controller:admin_image_folder,action:edit,id:{$id}" extra='?popup=1' onclick='return Limb.Http.click(this.href)' alt='Edit folder' title='Edit folder'><img src='/images/icon/action/edit.gif' width='24' height='24' /></route_url>&nbsp;&nbsp;
          <route_url params="controller:admin_image_folder,action:delete" extra='?popup=1&ids[]={$id}' onclick='return Limb.Http.click(this.href)' alt='Удалить подраздел' title='Удалить подраздел'><img src='/images/icon/action/delete.gif' width='24' height='24' /></route_url>
      </td>
    </tr>
  </list:item>
</table>
  <br/>
  <route_url_set field='delete_url' params="controller:admin_image_folder,action:delete" />
  <input type='submit' value='Delete' onclick='Limb.Form.submit(this.form, "{$delete_url}?popup=1");return false;'/>
</list:list>

</form>

<fetch using='src/fetcher/NodeKidsFetcher' target='files' navigator='pager'>
  <fetch:param controller='image' parent_id='{$id}' />
</fetch>

<h2>Folder images</h2>

<route_url params="controller:admin_image,action:create" extra='?popup=1&parent={$id}' onclick='return Limb.Http.click(this.href)'>Create image</route_url>

<core:include file='_cp/pager.html'>

<form name='list_form' method='post'>

<list:list id='files'>
<table cellpadding="0" cellspacing="0" class='list'>
  <tr class='header'>
    <th><core:INCLUDE file='_cp/selector.html'></th>
    <th>Icon</th>
    <th>Title</th>
    <th>Actions</th>
  </tr>
  <list:item>
    <tr>
      <td class='left'><input type='checkbox' name='ids[]' value='{$id}' class='input' runat='client'/></td>
      <td align='center'><img src='{$object.icon.show_url}'/></td>
      <td>{$title}</td>
      <td><route_url params="controller:admin_image,action:edit,id:{$id}" extra='?popup=1' onclick='return Limb.Http.click(this.href)'><img src='/images/icon/action/edit.gif' width='24' height='24' /></route_url>&nbsp;&nbsp;
          <route_url params="controller:admin_image,action:delete" extra='?popup=1&ids[]={$id}' onclick='return Limb.Http.click(this.href)'><img src='/images/icon/action/delete.gif' width='24' height='24' /></route_url>
      </td>
    </tr>
  </list:item>
</table>
  <br/>
  <route_url_set field='delete_url' params="controller:admin_image,action:delete" />
  <input type='submit' value='Delete' onclick='Limb.Form.submit(this.form, "{$delete_url}?popup=1");return false;'/>
</list:list>

</form>

</core:datasource>
</core:wrap>
